<?php
class Project_model extends Model
{
	function Project_model()
	{
		parent::Model();
	}
	
	function getEveryone()
	{
		$this->db->order_by("login", "asc");
//		$query = $this->db->get('admins');
		$query = $this->db->get('usuario');
		return $query->result();
	}
	
	function getOne ($id)
	{
		$this->db->where('id',$id);
		$query = $this->db->get('admins');
		if ($query->num_rows() == 1) 
		{
			return $query->row();
		} 
		else
		{
			return FALSE;		
		}			
	}
	
	function insert($data)
	{
		$this->db->insert('admins', $data);
	}
	
	function update ($id,$data)
	{
		$this->db->where('id', $id);
		$this->db->update('admins', $data);	
	}
	
	function delete ($id)
	{
		$this->db->where('id', $id);
		$this->db->delete('admins');
	}
		
}
?>
